package cn.lg.soar.system.general.entity;

import cn.lg.soar.database.base.entity.BaseEntity;
import cn.lg.soar.database.base.entity.ITenantEntity;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;

/**
 * @author luguoxiang
 * 开源项目：https://gitee.com/lgx1992/lg-soar 求star！请给我star！请帮我点个star！
 */
@ApiModel(value = "字典类型", description = "字典类型信息表")
@EqualsAndHashCode(callSuper = false)
@Getter
@Setter
@TableName("lg_sys_dict")
public class Dict extends BaseEntity implements ITenantEntity, Serializable {

    private static final long serialVersionUID = -3811562498256374413L;
    @ApiModelProperty(value = "主键id")
    @TableId
    private Long id;

    @ApiModelProperty(value = "字典类型code")
    private String code;

    @ApiModelProperty(value = "字典类型名称")
    private String name;

    @ApiModelProperty(value = "备注")
    private String remark;

    @ApiModelProperty(value = "是否禁用")
    private Boolean disabled;

    @ApiModelProperty(value = "是否是枚举值")
    @JsonProperty(access = JsonProperty.Access.READ_ONLY)
    private Boolean enumerated;

    @TableField(fill = FieldFill.INSERT)
    @ApiModelProperty(value = "创建人")
    private Long createBy;

    @TableField(fill = FieldFill.INSERT_UPDATE)
    @ApiModelProperty(value = "更新人")
    private Long updateBy;

    @ApiModelProperty(value = "租户id")
    @JsonIgnore
    @TableField(select = false)
    private Integer tenantId;

    @JsonIgnore
    @Override
    public Serializable primaryKey() {
        return this.id;
    }
}
